﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;

namespace Ramparts
{
    class AnimatedGameComponent : GameComponent
    {

        Dictionary<int, AnimatedSprite> animatedSprites;
        int currentAnimation;

        public AnimatedGameComponent(int x, int y, String textureName, SceneManager sceneManager)
        {
            animatedSprites = new Dictionary<int,AnimatedSprite>();
            this.sceneManager = sceneManager;
            this.position = new Vector2(x, y);
            animatedSprites.Add(0, new AnimatedSprite(textureName, sceneManager));
            currentAnimation = 0;
        }

        public override void Draw()
        {
            animatedSprites[currentAnimation].Draw(position);
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            animatedSprites[currentAnimation].Draw(position);
        }

    }
}
